import java.rmi.Naming;
import java.rmi.server.RemoteRef;

/**
 *
 * @author ulan
 */

public class RMIDegServer {
    
    public static void main(String[] args){
        
        try {
            RMIDegInftImpl servis = new RMIDegInftImpl();
            
            RemoteRef lokasi = servis.getRef();
            
            // print ipAdress
            System.out.println(lokasi.toString());
            
            String regis = "localhost";
            if(args.length >= 1){
                regis = args[0];
            }
            
            String reg = "rmi://"+regis+"/Degree";
            Naming.rebind(reg, servis);
            
        } catch (Exception e) {
        }
        
    }
    
}
